import { useRef } from "react";
import ReactDOM from "react-dom";

function App() {
    const h1 = useRef();
    return (
        <div className="App">
            <h1 ref={h1}>hello</h1>
            <button
                onClick={() => {
                    // console.log(h1.current);
                    console.log(ReactDOM.findDOMNode(h1.current));
                }}
            >
                点击
            </button>
        </div>
    );
}

export default App;
